Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ports a bug fix from PR #3857 to the release/6.1 branch, addressing issue #3845. The fix prevents a potential NullReferenceException when processing batch RPC commands with Always Encrypted enabled.
Changes:
- Added a null check for
systemParamsbefore accessing itsLengthproperty in theTryFetchInputParameterEncryptionInfomethod - Applied the fix consistently to both .NET Framework and .NET Core implementations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs |
Added null check before accessing systemParams.Length in batch RPC mode parameter encryption logic |
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs |
Added null check before accessing systemParams.Length in batch RPC mode parameter encryption logic |
cheenamalhotra
approved these changes
Jan 12, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/6.1 #3877 +/- ##
===============================================
- Coverage 65.42% 63.64% -1.79%
===============================================
Files 279 279
Lines 53302 53302
===============================================
- Hits 34875 33924 -951
- Misses 18427 19378 +951
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
paulmedynski
approved these changes
Jan 12, 2026
This was referenced Jan 15, 2026
This was referenced Feb 9, 2026
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Open
This was referenced Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Port #3857 to release/6.1
Closes #3845
Issues
#3845
Testing
To be introduced when addressing #3876
Guidelines
Please review the contribution guidelines before submitting a pull request: